package com.powell.health.activity;

import android.os.Bundle;
import com.powell.health.fragment.ItemDetailsFragment;

/**
 * Created with IntelliJ IDEA.
 * User: tpowell
 * Date: 12/27/12
 * Time: 5:17 PM
 * To change this template use File | Settings | File Templates.
 */
public class DetailsActivity extends AbstractHealthActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (isLandScape()) {
            return;
        }
        createNewItemDetailsFragment(savedInstanceState);
    }

    private void createNewItemDetailsFragment(Bundle savedInstanceState) {
        if (savedInstanceState == null) {
            ItemDetailsFragment details = new ItemDetailsFragment();
            details.setArguments(getIntent().getExtras());
            getFragmentManager().beginTransaction().add(android.R.id.content, details).commit();
        }
    }
}
